package com.itheima.a01staticdemo03;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        //1.创建一个集合用来存储学生对象
        ArrayList<Student> list = new ArrayList<>();
        //2.创建3个学生对象
        Student s1 = new Student("zhangsan", 18, "男");
        Student s2 = new Student("lisi", 19, "男");
        Student s3 = new Student("wangwu", 20, "女");
        //将三个学生对象添加在集合里
        list.add(s1);
        list.add(s2);
        list.add(s3);
        //4.调用工具类的方法
        int ageMax = Studentutil.getAgeMax(list);
        System.out.println(ageMax);
    }
}
